<?php

declare(strict_types=1);

use App\Core\Router;

// 首页路由
Router::get('/', 'HomeController@index');

// 健康检查
Router::get('/health', function () {
    return 'OK';
});


// 示例：带参数路由（稍后创建控制器）
// Router::get('/post/{id}', 'PostController@show');

// Posts CRUD
Router::get('/posts', 'PostController@index');
Router::get('/posts/create', 'PostController@create');
Router::post('/posts/create', 'PostController@store');
Router::get('/posts/{id}', 'PostController@show');
Router::get('/posts/{id}/edit', 'PostController@edit');
Router::post('/posts/{id}/edit', 'PostController@update');
Router::post('/posts/{id}/delete', 'PostController@destroy');

// Auth
Router::get('/login', 'AuthController@showLogin');
Router::post('/login', 'AuthController@login');
Router::get('/register', 'AuthController@showRegister');
Router::post('/register', 'AuthController@register');
Router::get('/logout', 'AuthController@logout');

// Admin
Router::get('/admin', 'AdminController@dashboard');

// Admin - Posts Management
Router::get('/admin/posts', 'AdminController@posts');

// Admin - Users Management
Router::get('/admin/users', 'AdminController@users');

// Admin - Logs
Router::get('/admin/logs', 'AdminController@logs');
Router::post('/admin/logs/clear', 'AdminController@clearLogs');

// Admin - Backup
Router::get('/admin/backup', 'AdminController@backup');
Router::post('/admin/backup/create', 'AdminController@createBackup');
Router::get('/admin/backup/download', 'AdminController@downloadBackup');
Router::post('/admin/backup/delete', 'AdminController@deleteBackup');

// Admin - Settings
Router::get('/admin/settings', 'AdminController@settings');
Router::post('/admin/settings/update', 'AdminController@updateSettings');

// Admin - Themes
Router::get('/admin/themes', 'AdminController@themes');
Router::post('/admin/themes/activate', 'AdminController@activateTheme');

// Theme
Router::get('/theme/switch', 'ThemeController@switch');
Router::get('/theme/preview', 'ThemeController@preview');
